home *** CD-ROM | disk | FTP | other *** search
- Path: dsi.unimi.it!moreld
- From: moreld@dsi.unimi.it (~ZIO BUDDA~)
- Newsgroups: comp.lang.c++
- Subject: Re: Ctors & member methods ?
- Date: 8 Feb 1996 13:45:47 GMT
- Organization: Computer Science Dep. - Milan University
- Message-ID: <4fcuqb$ms7@tic.sm.dsi.unimi.it>
- References: <3100187d.5776685@ixnews7.ix.netcom.com>
- NNTP-Posting-Host: tac.fddi.dsi.unimi.it
- X-Newsreader: TIN [version 1.2 PL2]
-
- n4jvp (n4jvp@ix.netcom.com) wrote:
- > I have a question concerning ctors. Can a ctor call a member
- > method?
-
- > class Foo
- > {
- > public:
- > Foo(){};
- > Foo( int a );
- > ~Foo(){};
- > void setlist( Ptr * b, Ptr * w );
- > private:
- > ...
- > };
-
- > Foo::Foo( int a ) // a is a boolean value
- > {
- > for( int i=0; i<16; i++ )
- > if( a ) // new data
- > {
- > do stuff and get 2 pointers;
- > bar( Ptr * b, Ptr * w);
- > }
- > else // restored data
- > {
- > do other stuff and get 2 pointers;
- > bar( Ptr * b, Ptr * w );
- > }
- > }
-
- > void Foo::bar( Ptr * b, Ptr * w )
- > {
- > do more stuff;
- > }
-
- I say Yes... By this way U call a function of Class Foo from another Function of class Foo.
- This is not strange... (I'm use GCC 2.6.3 on Linux Machine).
-
- Sorry for my bad english
- --
- Zio Budda "sempre alla ricerca di un account..." moreld@ghost.dsi.unimi.it
- http://www.dsi.unimi.it/Users/Students/moreld/home.html
- Ask me for questions about LINUX and Games for PC, and see my home page
- I'm a programmer and a consultant...
-
- Tel. 02/2139959 ... Chiedere di Davide Michel
-